<template>
  <view>
    <uv-navbar title="" auto-back placeholder />
    <view class="conetnt">
      <uv-text
        :text="
          type == 'USER_POLICY'
            ? '用户协议'
            : type == 'PRIVACY_POLICY'
            ? '隐私协议'
            : '其它协议'
        "
        size="28rpx"
        color="#212121"
        margin="0 0 30rpx 0"
      />
      <uv-parse
        :content="info?.content"
        container-style="font-size: 28rpx; color: #212121;"
      />
    </view>
  </view>
</template>
<script setup>
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { getArticle } from "@/request/user";

const type = ref(""); // 协议类型
const info = ref({}); // 协议信息

onLoad((e) => {
  type.value = e.type || "USER_POLICY";
  getInfo();
});

// 获取协议信息
const getInfo = () => {
  getArticle(type.value).then((res) => {
    info.value = res.data;
  });
};
</script>
<style lang="scss" scoped>
.conetnt {
  padding: 30rpx;
}
</style>
